package com.cloud.api.domain.tsp;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.api.myenum.CmdRelateEnum;
import com.cloud.api.validgroup.ValidateGroupInsert;
import com.cloud.api.validgroup.ValidateGroupUpdate;
import com.cloud.core.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author haohaibo
 * @since 2023-11-29
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_command")
@Schema(name = "Command", description = "")
public class Command extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    @NotEmpty(message = "{validation.common.id}",groups = ValidateGroupUpdate.class)
    private String id;

    @TableField("model_id")
    @NotEmpty(message = "{validation.command.modelId}",groups = ValidateGroupInsert.class)
    private String modelId;

    @TableField("command_sign")
//    @NotEmpty(message = "{validation.command.commandSign}",groups = ValidateGroupInsert.class)
    private String commandSign;

    @Schema(description = "下发命令")
    @TableField("command_code")
    @NotEmpty(message = "{validation.command.commandCode}",groups = ValidateGroupInsert.class)
    private String commandCode;

    @Schema(description = "指令名称，字典功能代码名称")
    @TableField("command_name")
    @NotEmpty(message = "{validation.command.commandName}",groups = ValidateGroupInsert.class)
    private String commandName;

    @Schema(description = "指令类型：手机、后台")
    @TableField("type")
    @NotEmpty(message = "{validation.command.type}",groups = ValidateGroupInsert.class)
    private String type;

    @Schema(description = "1勾选 , 0未勾选")
    @TableField("status")
    @NotNull(message = "{validation.command.status}",groups = ValidateGroupUpdate.class)
    private Integer status;

    @Schema(description = "功能代码：字典的数字")
    @TableField("function_code")
    @NotNull(message = "{validation.command.functionCode}",groups = ValidateGroupInsert.class)
    private Integer functionCode;

    @Schema(description = "控车项")
    @TableField("control_group")
    @NotNull(message = "{validation.command.controlGroup}",groups = ValidateGroupInsert.class)
    private String controlGroup;

    @Schema(description = "控车项明名称")
    @TableField(exist = false)
    @NotNull(message = "{validation.command.controlGroup}",groups = {ValidateGroupInsert.class, ValidateGroupUpdate.class})
    private String groupName;

    @Schema(description = "是否关联使能下发")
    @TableField("cmd_relate")
    private CmdRelateEnum cmdRelate;

    @Schema(description = "指令数量",hidden = true)
    @TableField(exist = false)
    private Integer count;
}
